package day9;

import java.util.Scanner;

public class Main {
    public int addAB(int A, int B) {
        // write code here
        while(B != 0) {
            int tmp = A^B;
            B = (A&B) << 1;
            A = tmp;
        }
        return A;
    }
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextInt()) { // 注意 while 处理多个 case
            int n = in.nextInt();
            int m = in.nextInt();
            System.out.println(cal(n,m));
        }
    }
    public static int cal(int n, int m) {
        if((n == 1 && m >=1) || (n >=1 && m ==1)) {
            return n+m;
        }
        return cal(n-1, m) + cal (n, m-1);
    }
}
